<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>人员新增</title>
    <script src="../../../../../res/js/jquery-3.4.1.min.js"></script>
    <script charset="utf-8" src="../../../../../res/layui/layui.js"></script>
    <script src="../../../../../res/js/Tools.js"></script>
    <link href="../../../../../res/layui/css/layui.css" media="all" rel="stylesheet">
    <link href="../../../../../res/echarts/eleTree.css" rel="stylesheet"/>
    <link rel="shortcut icon" type="image/x-icon" href="../../../../../res/images/favicon.ico">
    <script src="../../../../../res/echarts/eleTree.js"></script>
    <script charset="utf-8" src="../../../../../res/js/login_common.js"></script>
    <style type="text/css">
        body {
            padding: 10px;
        }
        .showFont{
            line-height: 38px;
        }
    </style>
</head>
<body>
<form action="" class="layui-form layui-form-pane">
    <input type="hidden" name="pkPersonnelId" id="pkPersonnelId" lay-verify="keyword">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">人员姓名</label>
            <div class="layui-input-inline" style="float: left">
                <input class="layui-input" id="personnelName" disabled type="text">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-inline">
                <input  class="layui-input"  id="organizationId"  disabled type="text">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">岗位</label>
            <div class="layui-input-inline">
                <input  class="layui-input"  id="organizationType" disabled type="text">
            </div>
        </div>
    </div>
    <div class="layui-form-item" pane="" >
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline" >
            <input  name="personnelSex" disabled id="sex" title="男" type="radio" value="1" checked="">
            <input name="personnelSex" disabled title="女" type="radio" value="0">
        </div>

    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">登录账号</label>
            <div class="layui-input-inline" style="float: left">
                <input  class="layui-input" disabled  id="personnelAccount"  type="text">
            </div>
        </div>

        <div class="layui-inline">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline" >
                <input class="layui-input" disabled id="personnelEmail" type="text">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">办公电话</label>
            <div class="layui-input-inline" >
                <input  class="layui-input" disabled id="personnelPhone" type="text">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">微信号</label>
            <div class="layui-input-inline" style="float: left">
                <input  class="layui-input" disabled  id="personnelWx" type="text">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">关键字</label>
            <div class="layui-input-inline" style="float: left">
                <input  class="layui-input" id="keyword" type="text" disabled>
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea" name="remark" disabled placeholder="请输入备注"></textarea>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'layedit', 'laydate', 'layer'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        ///修改操作
        const ide = getQueryString("pkPersonnelId");
        if (ide) {
            findById(ide);//修改页面的赋值
        }
        //重新渲染表单函数
        function renderForm() {
            layui.use('form', function () {
                var form = layui.form(); //高版本建议把括号去掉，有的低版本，需要加()
                form.render();
            });
        }

        form.render();
    });

    function findById(ide){
        let url=getRootPath()+"OaPersonnelAction/findById/"+ ide ;
        let data=getAjaxById(url);
        $("#pkPersonnelId").val(data.data.pkPersonnelId);
        $("#personnelName").val(data.data.personnelName);
        $("#organizationId").val(data.data.departmentName);
        $("#organizationType").val(data.data.postName);
        $("#personnelAccount").val(data.data.personnelAccount);
        $("#personnelEmail").val(data.data.personnelEmail);
        $("#personnelPhone").val(data.data.personnelPhone);
        $("#personnelWx").val(data.data.personnelWx);
        $("#keyword").val(data.data.keyword);
        if (data.data.personnelSex==0){
            $("#personnelSex").val("男");
        }else {
            $("#personnelSex").val("女");
        }

    }
</script>
</body>
</html>